<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=request.getContextPath()%>/css/base.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.pager.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/base.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/admin.js"></script>
<title>广告管理</title>
</head>
<style>
.adv{float:left}
.adv .img{float:left}
.adv .link{float:left;padding-left:10px;width:350px}
.adv .link DT{line-height:30px}
.adv .edit{float:left;padding-top:60px}
</style>
<BODY class=list><DIV class=bar>广告列表&nbsp;总记录数: ${fn:length(advs)}</DIV>
<DIV class=body>
<DIV class=listBar>
<INPUT hideFocus class=formButton onclick="location.href='advadd.do'" value=添加广告 type=button>
 &nbsp;&nbsp; 
</DIV>
<c:forEach items="${advs}" var="adv">
<DIV class=adv>
  <DIV class=img> <img src="<%=request.getContextPath()%>${adv.imgName}" width="400px" height="200px"/></DIV> 
  <DIV class=link>
    <DT>主链接:<a href="<%=request.getContextPath()%>/${adv.link}" target="_blank">${adv.link}</a></DT>  
    <DT>link1:<a href="<%=request.getContextPath()%>/${adv.link1}" target="_blank">${adv.link1}</a></DT>  
    <DT>link2:<a href="<%=request.getContextPath()%>/${adv.link2}" target="_blank">${adv.link2}</a></DT>  
    <DT>link3:<a href="<%=request.getContextPath()%>/${adv.link3}" target="_blank">${adv.link3}</a></DT>  
    <DT>link4:<a href="<%=request.getContextPath()%>/${adv.link4}" target="_blank">${adv.link4}</a></DT>  
    <DT>排序：${adv.sort}   状态：${adv.status==1?'显示':'隐藏'}</DT>  
  </DIV>
   <DIV class=edit>
       <DT><INPUT hideFocus class=formButton onclick="location.href='advedit.do?id=${adv.id}'" value=修改 type=button></DT>  
       <DT><INPUT hideFocus class=formButton onclick="del('${adv.id}')" value=删除 type=button></DT>  
  </DIV>
</DIV>

</c:forEach>

</DIV>
</BODY>

<SCRIPT type=text/javascript>
function del(id)
{
  $.dialog({type: "warn", content: "您确定要删除吗?", ok: "确 定", cancel: "取 消", modal: true, okCallback: deleteAdv});
  function deleteAdv(){
    location.href='advdel.do?id='+id;
  }

}
</SCRIPT>
</html>